Skip to content

Conversation

@stephancill
Copy link
Contributor

Summary

https://linear.app/coinbase/issue/BA-2376/sdk-update-default-sub-account-behavior

When enableAutoSubAccounts is false, we no longer automatically make the sub account the 'active' account. All requests meant for the sub accounts need to explicitly specify the sub account address.

In this mode, the sub account is always returned at index 1 when calling eth_requestAccounts and eth_accounts.

How did you test your changes?

Unit tests, manual testing in playground

@cb-heimdall
Copy link
Collaborator

cb-heimdall commented Jul 8, 2025

✅ Heimdall Review Status

Requirement Status More Info
Reviews 2/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@stephancill stephancill force-pushed the stephan/manual-subaccount-ordering branch from d9f686b to 29c2270 Compare July 8, 2025 14:49
@stephancill stephancill requested a review from fan-zhang-sv July 8, 2025 15:13
cb-jake
cb-jake previously approved these changes Jul 8, 2025
this.accounts = subAccountsConfig?.enableAutoSubAccounts
? prependWithoutDuplicates(this.accounts, subAccount.address)
: appendWithoutDuplicates(this.accounts, subAccount.address);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should have been doing this before here actually 🤔

montycheese
montycheese previously approved these changes Jul 8, 2025
@stephancill stephancill dismissed stale reviews from montycheese and cb-jake via 10d8e8d July 8, 2025 16:34
@stephancill stephancill force-pushed the stephan/manual-subaccount-ordering branch from 587a943 to 10d8e8d Compare July 8, 2025 16:34
@stephancill stephancill requested review from cb-jake and montycheese and removed request for cb-jake July 8, 2025 16:35
@stephancill stephancill enabled auto-merge (squash) July 8, 2025 17:36
@stephancill stephancill merged commit cceea58 into master Jul 8, 2025
8 checks passed
@stephancill stephancill deleted the stephan/manual-subaccount-ordering branch July 8, 2025 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants